package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** GameLevelMonster数据管理 */
public class GameLevelMonsterDBModel extends AbstractDBModel<GameLevelMonsterDBModel, GameLevelMonsterEntity>
{
    private static GameLevelMonsterDBModel instance;

    public static GameLevelMonsterDBModel getInstance() {
        if (instance == null) {
            instance = new GameLevelMonsterDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "GameLevelMonster.data";
    }

    /** 创建实体 */
    @Override
    protected GameLevelMonsterEntity MakeEntity(GameDataTableParser parse)
    {
        GameLevelMonsterEntity entity = new GameLevelMonsterEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.GameLevelId = parse.GetFieldValueToInt("GameLevelId");
        entity.Grade = parse.GetFieldValueToInt("Grade");
        entity.RegionId = parse.GetFieldValueToInt("RegionId");
        entity.SpriteId = parse.GetFieldValueToInt("SpriteId");
        entity.SpriteCount = parse.GetFieldValueToInt("SpriteCount");
        entity.Exp = parse.GetFieldValueToInt("Exp");
        entity.Gold = parse.GetFieldValueToInt("Gold");
        entity.DropEquip = parse.GetFieldValueToUTF8String("DropEquip");
        entity.DropItem = parse.GetFieldValueToUTF8String("DropItem");
        entity.DropMaterial = parse.GetFieldValueToUTF8String("DropMaterial");
        return entity;
    }
}
